package com.hanainfo.hanaApp;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;

import org.json.simple.JSONObject;
import org.json.simple.JSONValue;

import com.hanainfo.common.DrawBall;
import com.hanainfo.db.DataBaseHelper;

import android.app.Activity;
import android.database.sqlite.SQLiteOpenHelper;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;

public class viewActivity extends Activity{
	
	private SQLiteOpenHelper mOpenHelper;
	private ImageView iv1;
	private ImageView iv2;
	private ImageView iv3;
	private ImageView iv4;
	private ImageView iv5;
	private ImageView iv6;
	private BallBean ballBean;
	
	private static final String MY_TB_NAME = "test";
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.listview);
	    mOpenHelper = new DataBaseHelper(this);
	    
	    
		
		ballBean = new DataBaseHelper(this).lastBall(); // 만들고 보니 굳이 빈이 필요가 없는듯.....
		/*ballBean.setFirstBall((String)job.get("FirstBall"));
		ballBean.setSecondBall((String)job.get("SecondBall"));
		ballBean.setThirdBall((String)job.get("ThirdBall"));
		ballBean.setFourthBall((String)job.get("FourthBall"));
		ballBean.setFifthBall((String)job.get("FifthBall"));
		ballBean.setSixthBall((String)job.get("SixthBall"));
		ballBean.setGrwno((String)job.get("Grwno"));
		ballBean.setGrwDate((String)job.get("GrwDate"));*/
	    
	    iv1 = (ImageView) findViewById(R.id.imageView1);
	    iv2 = (ImageView) findViewById(R.id.imageView2);
	    iv3 = (ImageView) findViewById(R.id.imageView3);
	    iv4 = (ImageView) findViewById(R.id.imageView4);
	    iv5 = (ImageView) findViewById(R.id.imageView5);
	    iv6 = (ImageView) findViewById(R.id.imageView6);
	    DrawBall draw = new DrawBall(getBaseContext());
	    draw.setDrawble(iv1, ballBean.getFirstBall());
	    draw.setDrawble(iv2, ballBean.getSecondBall());
	    draw.setDrawble(iv3, ballBean.getThirdBall());
	    draw.setDrawble(iv4, ballBean.getFourthBall());
	    draw.setDrawble(iv5, ballBean.getFifthBall());
	    draw.setDrawble(iv6, ballBean.getSixthBall());
	    
	}
}
